home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / irix / scripts / treegrep < prev    next >
Encoding:
Text File  |  1994-08-02  |  530 b   |  21 lines

  1. #! /bin/csh -xv
  2. #
  3. #    treegrep    fgrep a string through an entire directory tree.
  4. #
  5. # Synopsis:
  6. #    treegrep <dir> <str> <file-spec>
  7. #
  8. # Where:
  9. #    <dir>    is the top directory to start in.
  10. #    <str>    is the string to grep for.
  11. #    <file-spec> is the file specification to grep through.  Note that
  12. #        wild cards must be escaped.
  13. #--------------------------------------------------------------------------
  14.  
  15. set dir = $1
  16. set str = $2
  17. set file = $3
  18.  
  19. find $dir -name $file -exec fgrep $str {} \; -exec echo "\c" \; \
  20.     -print -exec echo "" \;
  21.